package com.bonc.modules.dial.controller;


import cn.hutool.core.util.ObjectUtil;
import com.bonc.common.utils.Result;
import com.bonc.modules.dial.entity.ServDialTestDataMon;
import com.bonc.modules.dial.service.ServDialTestDataMonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/dialTestData")
public class ServDialTestDataMonController {

    @Autowired
    private ServDialTestDataMonService servDialTestDataMonService;

    @GetMapping("/page")
    @ResponseBody
    public Result page(ServDialTestDataMon servDialTestDataMon) {

        return Result.ok().put("page", servDialTestDataMonService.selectPage(servDialTestDataMon));
    }

    @GetMapping("/getDevType")
    @ResponseBody
    public Result getDevType(String beginDate) {
        if(ObjectUtil.isNotEmpty(beginDate)) {
            return Result.ok().put("data", servDialTestDataMonService.queryDevType(beginDate));
        } else {
            return Result.ok("处理日期不能为空");
        }
    }
}
